package com.algorithm.cn.linkedlist;

import java.util.Stack;

/**
 * 
 * @author wangzonghui
 * @date 2020-12-21 22:05:38
 * @Description: 演示栈的基本用法
 */
public class TestStack {
	
	public static void main(String[] args) {
		Stack<String> stack=new Stack<>();
		
		//入栈
		stack.add("jack");
		stack.add("tom");
		stack.add("smith");
		
		//出栈
		while(stack.size()>0) {
			System.out.println(stack.pop());
		}
	}
}
